home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
TPUG - Toronto PET Users Group
/
TPUG Users Group CD
/
TPUG Users Group CD.iso
/
AMIGA
/
AMICUS
/
AMICUS11.ADF
/
Assembler
/
cls.ASM
< prev
next >
Wrap
Assembly Source File
|
1986-08-05
|
1KB
|
61 lines
*******************************************************************************
*
* cls - clear screen cli utility
*
* author: Tom Caldwell of Sound Design Software
*
* an assembly example of passing parameters and using the cli output file
*
*******************************************************************************
TTL cls
section 0
EXT_SYS MACRO
XREF _LVO\1
ENDM
SYS MACRO
JSR _LVO\1
ENDM
EXT_SYS OpenLibrary
EXT_SYS Output
EXT_SYS Write
EXT_SYS CloseLibrary
XREF _AbsExecBase
MsgLen EQU 28
; when cli executes a program it passes the pointer to the parameters in A0
; and the length in D0
CMP.B #'?',(A0) ; question mark
BEQ.S QuestMark ;-yes
MOVE.L #ClrScn,D2 ;-no, write out form feed
MOVEQ #1,D3 ; length
BRA.S Cont
QuestMark
MOVE.L #Mesg,D2 ; display message
MOVEQ #MsgLen,D3 ; length
Cont
MOVE.L _AbsExecBase,A6 ; open dos library
LEA.L DosName,A1
MOVEQ #0,D0
SYS OpenLibrary(A6)
MOVE.L D0,A5 ; get output handle
SYS Output(A5)
MOVE.L D0,D1 ; write to output file
SYS Write(A5)
MOVE.L A5,A1 ; close dos library
SYS CloseLibrary(A6)
MOVEQ #0,D0
RTS
DosName DC.B 'dos.library',0
ClrScn DC.B $C
Mesg DC.B 'Parameters are not required',$A
end